// Copyright (C) joyinter
// All rights reserved.
// 
// Author : Jiang Li
// Date   : 2004-6-6

#ifndef __JSOCKET_H_COMMON_BASE__
#define __JSOCKET_H_COMMON_BASE__

#pragma once

#include "sockbase.h"

//##ModelId=44CF17580063
enum JoySocketState
{
	//##ModelId=44CF1758006E
    JSS_None,
	//##ModelId=44CF1758006F
    JSS_Connecting,
	//##ModelId=44CF17580070
    JSS_Connected,
};

//##ModelId=44CF17580071
class CJoySocket : public CJoySockBase
{
public:
	//##ModelId=44CF17580093
    typedef CSocket CBaseType;
protected:
	//##ModelId=44CF1758007F
    JoySocketState      m_state;


	//##ModelId=44CF17580083
    virtual void OnConnect(int nErrorCode);
	//##ModelId=44CF1758008C
    virtual void OnClose();

public:
	//##ModelId=44CF1758008E
	CJoySocket();
	//##ModelId=44CF1758008F
	virtual ~CJoySocket();

	//##ModelId=44CF17580091
    bool IsConnected() const
    {
        return m_state == JSS_Connected;
    }
};

#endif  // __JSOCKET_H_COMMON_BASE__
